package School;
//？？？抽象类和接口中的成员变量和属性是什么类型的
//？？？接口中的抽象方法删除了好像也不影响程序的运行
interface shape{
    public static final double PI=3.14159;
    public abstract double Area();
    public abstract double Perimeter();
}
class circle implements shape{
    double r;
    public circle(double r){
        this.r=r;
    }
    public double Area(){
        return PI*r*r;
    }
    public double Perimeter(){
        return 2*PI*r;
    }
}
class square implements shape{
    double x;
    public square(double x){
        this.x=x;
    }
    public double Area(){
        return x*x;
    }
    public double Perimeter(){
        return 4*x;
    }
}
public class TestDemo2 {
    public static void main(String[] args) {
        circle c=new circle(3.4);
        System.out.println("圆的面积为："+c.Area());
        System.out.println("圆的周长为："+c.Perimeter());
        square s=new square(4);
        System.out.println("正方形的面积为："+s.Area());
        System.out.println("正方形的周长为："+s.Perimeter());
    }
}
